package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;

/**
 * <p>
 * ${table.comment!} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {

    /**
    * <p>
        * 更新所有字段
        * </p>
    */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateAll(${entity} entity) {

<#if table.fields??>
        update(
            Wrappers.lambdaUpdate(${entity}.class)
    <#list table.fields as field>
        <#if field.propertyType == "boolean">
            <#assign getprefix="is"/>
        <#else>
            <#assign getprefix="get"/>
        </#if>
                .set(${entity}::${getprefix}${field.capitalName}, entity.${getprefix}${field.capitalName}()) //${field.comment}
    </#list>
        );
</#if>
    }
}
